package com.fei.jvmtest.method;

public enum BaseType {
	f_byte("B", "byte"), 
	f_char("C", "char"), 
	f_double("D", "double"), 
	f_float("F", "float"), 
	f_int("I","int"),
	f_long("J", "long"),
	f_short("S", "short"),
	f_boolean("Z", "boolean"),
	f_void("V", "void");

	private String shortName;
	private String name;

	private BaseType(String shortName, String name) {
		this.shortName = shortName;
		this.name = name;
	}
	
	public static String getTypeByShortName(char shortName){
		BaseType[] types = BaseType.values();
		for(BaseType type : types){
			if(type.shortName.equals(shortName)){
				return type.name;
			}
		}
		
		return null;
	}
	
	public String getShortName() {
		return shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
